package dao;

// Generated 04-Apr-2011 11:04:34 by Hibernate Tools 3.4.0.CR1

import java.util.List;
import hibernate.HibernateDAO;
import beans.TbParadamaquina;
import javax.ejb.Stateless;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

/**
 * Home object for domain model class TbParadamaquina.
 * @see dao.TbParadamaquina
 * @author Hibernate Tools
 */
@Stateless
public class TbParadamaquinaDAO extends HibernateDAO<TbParadamaquina, Integer> {
	public List<TbParadamaquina> ListarPorBoleto(long boleto) {
		return listByCriteria(Order.asc("paradamaquinaId"), Restrictions.eq("tbBoleto.boletoCod", boleto));
	}
	
	public TbParadamaquina SelecionarParadaAtual(int maq) {
		return findByCriteria(Restrictions.eq("tbMaquina.maquinaCod", maq), Restrictions.isNull("paradamaquinaDatahoratermino"));		
	}
}
